package com.woniu.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.dao.TenementMapper;
import com.woniu.pojo.Leasefile;
import com.woniu.pojo.Tenement;
import com.woniu.service.TenementService;

@Service
public class TenementServiceImpl implements TenementService{
		@Autowired
		private TenementMapper tenementMapper;

		@Override
		public Tenement getTenementByid(Integer t_id) {
			// TODO Auto-generated method stub
			return tenementMapper.getTenementByid(t_id);
		}

		@Override
		public PageInfo<Tenement> getAllTenementByPage(int i, Integer length, Tenement tenement) {
			PageHelper.startPage(i,length);
			List<Tenement>list=tenementMapper.getAllTenement(tenement);
			PageInfo<Tenement> pageInfo=new PageInfo<Tenement>(list);     
			// TODO Auto-generated method stub
			return pageInfo;
		}



		@Override
		public void UpdateTenementInfo(Tenement tenement) {
			// TODO Auto-generated method stub
			tenementMapper.UpdateTenementInfo(tenement);
		}

		@Override
		public void deleteTenementByid(Integer t_id) {
			// TODO Auto-generated method stub
			tenementMapper.deleteTenementByid(t_id);
		}

		@Override
		public void deleteTenementsById(String t_ids) {
			// TODO Auto-generated method stub
			tenementMapper.deleteTenementsById(t_ids);
		}

		@Override
		public void addTenement(Tenement tenement) {
			// TODO Auto-generated method stub
			tenementMapper.addTenement(tenement);
		}

		@Override
		public Tenement getTenementBytenement_id(String tenement_id) {
			// TODO Auto-generated method stub
			return tenementMapper.getTenementBytenement_id(tenement_id);
		}

		
}
